
<script language="javascript">
function post_page()
{
	var search_val = $('#search_val').val();
	document.news.action = "index.php?page=technology&view=technology_news&mode=view_page&srch_id="+search_val;
	document.news.method="post";
	document.news.submit();
}
</script>
<?php 

if(($_GET['mode']=="") and ($_GET['news_id']==""))
{
$sql = "SELECT *	FROM ".$base_obj->NEWS." where 	Status='1' ORDER BY Id desc limit 0,1";

}
$res = $base_obj->exec_query($sql);
$data = $base_obj->fetch_row($res);

?>
<style type="text/css">
h2
{
	margin:0;
	 margin-left: 8px;
	padding:0;
	font-family:Arial;
	font-size:12px;
	color:#098BBB;
}
 p {
    color: #999999;
    font-family: Arial;
    font-size: 12px;
    font-weight: normal;
    line-height: 20px;
    margin-bottom: 0;
    margin-left: 0px;
    margin-right: 0;
    margin-top: 0;
    padding-bottom: 0px;
    padding-left: 5px;
    padding-right: 5px;
    padding-top: 0;
	
}
a {
    color: #FF9900;
    font-family: Arial;
    font-size: 12px;
    text-decoration: none;
}
a:hover
{
	color: #000;
    font-family: Arial;
    font-size: 12px;
    text-decoration: none;
}
	
</style>

  <div class="contentwarpMain" style="border-bottom: 1px solid #E4E4E4;" >
    <!-- Begin ContentBox -->
    <div align="right" style="padding-top:160px; margin-right:23px;">
   
    <form name="news" method="post"> 
    <select name="search_val" id="search_val" onchange="return post_page();" class="txtborder">
  	<option value="0" selected="selected">- Select -</option>
    <?php echo $base_obj->get_newscat();?></select>   
    </form> </div>
   <?php if($_GET['mode']==""){?>
    <h2 style="font-size:14px;"><?php echo $data['Title'];?></h2>
    <div style="float:left;margin:10px;"><p>
    <?php echo $data['News'];
	?></p>
    <?php 
   }
   
   ?>
   
   <?php 
   if($_GET['news_id']!="")
{
	 $sql = "SELECT *	FROM ".$base_obj->NEWS." where  Id='".$_GET['news_id']."' and 	Status='1' ORDER BY Id desc limit 0,1";
	 $res = $base_obj->exec_query($sql);
     $data = $base_obj->fetch_row($res);
	 if($data['Content']!="")
				{
					$href_txt = 'href="uploads/news/'.$data['Content'].'"';
				}	
				else {
					$href_txt = 'href="javascript:;" onclick="alert(\'File Not Exist\');" ';
				}
				
	 echo '<div style="height:auto; width:900px; background-color:#FFF; border:#ccc solid 0px; margin-left:15px;">';
    	echo   '<h2 style="font-size:16px;">'.$data['Title'].'</h2>';
		echo   '<p>'.$data['News'].'</p>';
		$dateArray=explode('-',$data['CreatedDate']);
	$get=date('M j, Y', mktime(0, 0, 0, $dateArray[1], $dateArray[2], $dateArray[0]));
	 echo '<div align="right" style="color:#999999; height:30px; border-top:1px solid #E4E4E4; margin-top:10px; padding:5px 5px 5px 5px;" class="font12"><b>Category :</b> &nbsp;'.stripcslashes($data['Category']).'&nbsp;,<b>Created Date :</b>&nbsp;'.
	$get.'&nbsp;,<b> Organisation :</b> &nbsp;'.stripcslashes($data['Organisation']).'&nbsp;<a '.$href_txt.'>More&raquo;</a></div>';
	echo '</div>';
}
?>
   <?php 


if($_GET['mode']=="view_page")
  {

	 $sql = "SELECT * 	FROM ".$base_obj->NEWS." where Category='".$_POST['search_val']."' and 	Status='1' ORDER BY Id limit 0,10";
	$query=mysql_query($sql); 
	$count= mysql_num_rows($query);
	if ($count>0)
	{
	while($data = mysql_fetch_array($query))
	{
		
	 if($data['Content']!="")
				{
					$href_txt = 'href="uploads/news/'.$data['Content'].'"';
				}	
				else {
					$href_txt = 'href="javascript:;" onclick="alert(\'File Not Exist\');" ';
				}	
	?>
<br />
	
<div style="height:auto; width:900px; background-color:#FFF; border:#ccc solid 0px; margin-left:15px;">
	<h2 style="padding-left:0px; font-size:16px;"><?php echo $data['Title'];?></h2><br />
	<?php echo '<span class="font12">'.stripcslashes($data['News']).'</span>';
	 $dateArray=explode('-',$data['CreatedDate']);
	$get=date('M j, Y', mktime(0, 0, 0, $dateArray[1], $dateArray[2], $dateArray[0]));
	 echo '<div align="right" style="color:#999999; height:30px; border-top:1px solid #E4E4E4; margin-top:10px; padding:5px 5px 5px 5px;" class="font12"><b>Category :</b> &nbsp;'.stripcslashes($data['Category']).'&nbsp;,<b>Created Date :</b>&nbsp;'.
	$get.'&nbsp;,<b> Organisation :</b> &nbsp;'.stripcslashes($data['Organisation']).'&nbsp;<a '.$href_txt.'>More&raquo;</a></div>';
	?>
    
 
    </div><br />
	<?php }}
	
	else
	{
		echo '<p style="text-align:center;font-weight:bold;color:#0488B9;">No Details Found For this Search </p>';
	}
  }
	?>
   
    </div>
  </div>      
  <?php include("includes/right_content.php");?>
  <!-- End contentwarp -->
 
  <div style="clear:both; "></div>
